package com.ruyuan.user.server.domain.strategy;

import com.ruyuan.user.server.domain.model.AuthResource;
import com.ruyuan.user.server.domain.model.Authority;

import java.util.Arrays;
import java.util.List;

/**
 * @author xx
 */
public class OperationAuthorityGenerateStrategy implements AuthorityGenerateStrategy{

    @Override
    public List<Authority> generateAuthorities(AuthResource authResource) {
        Authority authority = new Authority();
        authority.setName(authResource.getName() + "_的使用权限");
        authority.setCode(authResource.getCode() + "_Use");
        authority.setAuthResourceId(authResource.getId());
        authority.setDescription("功能描述:" + authResource.getDescription());
        authority.setModifier(authResource.getModifier());
        return Arrays.asList(authority);
    }

}
